<%@ page import="java.sql.Date" %>
<%@ page import="java.text.DateFormat" %>
<%@ page import="java.util.Locale" %>
<%--

  @author Kusal Samarakoon
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<script src="${pageContext.request.contextPath}/js/printer.js" type="text/javascript"></script>

<script type="text/javascript">
    $(document).ready(function() {
        var dO = new Date();
        var d = dO.getDate();
        var m = dO.getMonth();
        var y = dO.getFullYear();
        var today = d + "/" + m + "/" + y;
        /*$('#dueDateId').DatePicker({
         format:'m/d/Y',
         date:dO,
         current: dO,
         starts: 1,
         position: 'right',
         onBeforeShow: function() {
         $('#dueDateId').DatePickerSetDate(dO, true);
         },
         onChange: function(formated, dates) {
         $('#dueDateId').val(formated);
         }
         });*/
        $('#date').text(today)
        $("#save-dueDate-from").validate({
            rules:{
                dueDateId:{
                    required:true
                }
            },
            messages:{
                dueDateId:{
                    required:"Please enter the due date"
                }
            }
        });
    });
</script>

<div id="org-info-module-home-title" class="module-home-title">
    <s:a href="landAlienationModuleHome.do"><img src="${pageContext.request.contextPath}/images/interest-party.png"
                                                        alt="Land Alienation"><span><s:label
            value="%{getText('land_alienation.label')}"/></span></s:a>
    <span class="module-title-breaker"> > </span>
    <s:a href="getAllocationApprovedApplications.do?workflowAction=land+allocated">
            <img src="${pageContext.request.contextPath}/images/post_letter.png" alt="Alienation">
            <span><s:label value="%{getText('genarate_letter_for_land_application.label')}"/></span>
    </s:a>
    <s:include value="../printCaller.jsp"/>
</div>
<s:if test="hasActionErrors() || hasActionMessages()">
    <div id="message-box" class="message-box">
        <div class="action-msg"><s:actionmessage/></div>
        <div class="action-err"><s:actionerror/></div>
    </div>
</s:if>
<div id="set-due-date" class="form-outer">
    <div class="page-title">
        <h2> <span><s:label
                value="%{getText('genarate_letter_for_land_application.label')}"/></span></h2>
    </div>
    <s:form action="saveDueDateAllocatedApplication.do" method="POST" id="save-dueDate-from">
        <table class="width-100">
            <tr>
                <td><s:label value="%{getText('due_date.label')}" cssClass="mandatory-field"/><s:label
                        value="%{getText('date_format.label')}" cssClass="date-format"/></td>
                <td colspan="2">
                    <s:textfield name="dueDate" id="dueDateId" onclick="selectDate('dueDateId')"
                                 cssClass="datePicker"/>
                    <s:submit value="%{getText('save.label')}"/>
                </td>
                <s:hidden name="applicationId"/>
            </tr>
            <%--<tr>
                <td><s:label value="%{getText('due_date.label')}" /></td>
                <td><s:label name=" landApplication.getDueDate()" cssClass="float-left"/></td>
            </tr>--%>

        </table>
    </s:form>


    <hr>
</div>

<div id="printDivId" class="form-outer">

    <s:label value="Divisional Secretariat" cssClass="float-left"/><br>
    <s:label name="user.getDsDivisions().iterator().next().getEnDivisionName()" cssClass="float-left"/><br>
    <br>

    <s:label name="landApplication.getHolder().getName()" cssClass="float-left"/><br>
    <s:label name="landApplication.getHolder().getContacts().getAddress()" cssClass="float-left"/><br>

    <br>

    <s:label value="Dear Applicant, " cssClass="float-left"/>&nbsp;&nbsp;<%--<s:label name="headOfGO.name"
                                                                           cssClass="float-left"/><s:label value=","
                                                                                                         cssClass="float-left"/>--%><br>
     <h3> <span><s:label
                value="%{getText('genarate_letter_for_land_application.label')}"/></span></h3>

    <p style="text-align:justify;">A land has been allocated for your application.
        Please submit the duly completed application enclosed before <s:label name=" landApplication.getDueDate()" cssClass="bold-label-tag"/>.
            Otherwise the land will be re-allocated to another selected candidate.</p>

    <p style="text-align:justify;">Reference Number :
        <s:label name="landApplication.getRefNumber()"/></p>  <br>


    <s:label value="Regards," cssClass="float-left"/><br><br>
    <s:label value="-----------------------------" cssClass="float-left"/> <br>
    <s:label value="(Signature)" cssClass="float-left"/> <br>
    <s:label name="user.fullName" cssClass="float-left"/> <br>
    <s:label value="lo" cssClass="float-left"/> <br>
    <hr>
</div>


<%--<s:include value="../printCaller.jsp"/>--%>


<%--<div id="printbtn" class="form-button-div right-align">
    &lt;%&ndash;<input type="button" value="Print" id="print"  class="print-btn">&ndash;%&gt;
    <input type="button" value="Print" onclick="getPortraitPrintOut()">
    <input type="button" value="Cancel" onclick="goBack()">

</div>--%>




